package org.springblade.modules.admin.entity.feishu;

import cn.hutool.core.date.DateUtil;
import lombok.Data;
import org.springblade.modules.admin.dto.ElevatorStopPlanSimpleDTO;

/**
 * @Date 11:32 2024/5/28
 * @Description {
 *   飞书发送停梯通知模板
 * }
 * @Author lsay
 **/
@Data
public class FeiShuElevatorStopCertContentTemplate {

	private String certContentTemplate;

	public FeiShuElevatorStopCertContentTemplate(Long planId, Integer msgType,Integer contentType, Integer stopHour, ElevatorStopPlanSimpleDTO dto) {
		if(msgType.equals(1)){
			String desc;
			if(contentType != 3){
				desc = "已停梯"+stopHour+"小时，维修人员尚未到达现场，请及时跟踪并确认是否增派。";
			}else {
				desc = "已停梯"+stopHour+"小时，维修人员尚未到达现场，请及时跟踪。";
			}
			this.certContentTemplate = "{\"config\":{},\"i18n_elements\":{\"zh_cn\":[{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**项目名称：**\\n"+dto.getBuildingName()+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**电梯位置：**\\n"+dto.getElevatorAddress()+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**工单创建：**\\n"+DateUtil.format(dto.getPlanCreateTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**人员指派：**\\n"+DateUtil.format(dto.getPlanUserCreateTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"horizontal_spacing\":\"default\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"elements\":[{\"tag\":\"div\",\"text\":{\"tag\":\"plain_text\",\"content\":\""+desc+"\\n\",\"text_size\":\"normal\",\"text_align\":\"left\",\"text_color\":\"default\"}}],\"width\":\"weighted\",\"weight\":1}]},{\"tag\":\"action\",\"actions\":[{\"tag\":\"button\",\"text\":{\"tag\":\"plain_text\",\"content\":\"查看详情\"},\"type\":\"default\",\"complex_interaction\":true,\"width\":\"default\",\"size\":\"medium\",\"multi_url\":{\"url\":\"\",\"pc_url\":\"https://admin.sida-tech.com/#/tasks/allTasks/allTasksRepair?id="+planId+"\",\"ios_url\":\"\",\"android_url\":\"\"}}]}]},\"i18n_header\":{\"zh_cn\":{\"title\":{\"tag\":\"plain_text\",\"content\":\"停梯"+stopHour+"小时预警通知\"},\"subtitle\":{\"tag\":\"plain_text\",\"content\":\"\"},\"template\":\"blue\"}}}";
		}
		if(msgType.equals(2)){
			String desc;
			String title;
			if(contentType == 1){
				desc = "已停梯"+stopHour+"小时，维修人员【"+dto.getNotSignOutUserName()+"】已作业2小时尚未签退，请及时跟踪并确认是否增派。";
				title = "停梯工单作业2小时未签退预警通知";
			}else {
				desc = "已停梯"+stopHour+"小时，维修人员【"+dto.getNotSignOutUserName()+"】已作业4小时尚未签退，请及时跟踪。";
				title = "停梯工单作业4小时未签退预警通知";
			}
			this.certContentTemplate = "{\"config\":{},\"i18n_elements\":{\"zh_cn\":[{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**项目名称：**\\n"+dto.getBuildingName()+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**电梯位置：**\\n"+dto.getElevatorAddress()+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**工单创建：**\\n"+DateUtil.format(dto.getPlanCreateTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**人员指派：**\\n"+DateUtil.format(dto.getPlanUserCreateTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**人员签到：**\\n"+DateUtil.format(dto.getFirstSignTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"horizontal_spacing\":\"default\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"elements\":[{\"tag\":\"div\",\"text\":{\"tag\":\"plain_text\",\"content\":\""+desc+"\\n\",\"text_size\":\"normal\",\"text_align\":\"left\",\"text_color\":\"default\"}}],\"width\":\"weighted\",\"weight\":1}]},{\"tag\":\"action\",\"actions\":[{\"tag\":\"button\",\"text\":{\"tag\":\"plain_text\",\"content\":\"查看详情\"},\"type\":\"default\",\"complex_interaction\":true,\"width\":\"default\",\"size\":\"medium\",\"multi_url\":{\"url\":\"\",\"pc_url\":\"https://admin.sida-tech.com/#/tasks/allTasks/allTasksRepair?id="+planId+"\",\"ios_url\":\"\",\"android_url\":\"\"}}]}]},\"i18n_header\":{\"zh_cn\":{\"title\":{\"tag\":\"plain_text\",\"content\":\""+title+"\"},\"subtitle\":{\"tag\":\"plain_text\",\"content\":\"\"},\"template\":\"blue\"}}}";
		}
		if (msgType.equals(3)) {
			String desc = "由【停梯】变更为【运行中】操作人员【"+dto.getFirstSignUserName()+"】，请及时跟踪确认电梯的真实运行状态。";
			this.certContentTemplate = "{\"config\":{},\"i18n_elements\":{\"zh_cn\":[{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**项目名称：**\\n"+dto.getBuildingName()+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**电梯位置：**\\n"+dto.getElevatorAddress()+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**工单创建：**\\n"+DateUtil.format(dto.getPlanCreateTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**人员指派：**\\n"+DateUtil.format(dto.getPlanUserCreateTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**人员签到：**\\n"+DateUtil.format(dto.getFirstSignTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"horizontal_spacing\":\"default\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"elements\":[{\"tag\":\"div\",\"text\":{\"tag\":\"plain_text\",\"content\":\""+desc+"\\n\",\"text_size\":\"normal\",\"text_align\":\"left\",\"text_color\":\"default\"}}],\"width\":\"weighted\",\"weight\":1}]},{\"tag\":\"action\",\"actions\":[{\"tag\":\"button\",\"text\":{\"tag\":\"plain_text\",\"content\":\"查看详情\"},\"type\":\"default\",\"complex_interaction\":true,\"width\":\"default\",\"size\":\"medium\",\"multi_url\":{\"url\":\"\",\"pc_url\":\"https://admin.sida-tech.com/#/tasks/allTasks/allTasksRepair?id="+planId+"\",\"ios_url\":\"\",\"android_url\":\"\"}}]}]},\"i18n_header\":{\"zh_cn\":{\"title\":{\"tag\":\"plain_text\",\"content\":\"停梯工单签到恢复正常运行预警通知\"},\"subtitle\":{\"tag\":\"plain_text\",\"content\":\"\"},\"template\":\"blue\"}}}";
		}
		if (msgType.equals(4)) {
			String desc = "维修人员【"+dto.getFirstSignOutUserName()+"】已签退，电梯状态由【"+dto.getInitStatusName()+"】变更为【"+dto.getSetStatusName()+"】,请及时跟踪确认电梯的真实运行状态，并通知客户。";
			this.certContentTemplate = "{\"config\":{},\"i18n_elements\":{\"zh_cn\":[{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"horizontal_spacing\":\"8px\",\"horizontal_align\":\"left\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"vertical_spacing\":\"8px\",\"background_style\":\"default\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**项目名称：**\\n"+dto.getBuildingName()+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"vertical_spacing\":\"8px\",\"background_style\":\"default\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**电梯位置：**\\n"+dto.getElevatorAddress()+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"horizontal_spacing\":\"8px\",\"horizontal_align\":\"left\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"vertical_spacing\":\"8px\",\"background_style\":\"default\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**工单创建：**\\n"+DateUtil.format(dto.getPlanCreateTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"vertical_spacing\":\"8px\",\"background_style\":\"default\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**人员指派：**\\n"+DateUtil.format(dto.getPlanUserCreateTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"horizontal_spacing\":\"8px\",\"horizontal_align\":\"left\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"vertical_spacing\":\"8px\",\"background_style\":\"default\",\"elements\":[{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**人员签到：**\\n"+DateUtil.format(dto.getFirstSignTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1},{\"tag\":\"column\",\"width\":\"weighted\",\"vertical_align\":\"top\",\"elements\":[{\"tag\":\"markdown\",\"content\":\"**人员签退：**\\n"+DateUtil.format(dto.getFistSignOutTime(),"yyyy-MM-dd HH:mm:ss")+"\",\"text_align\":\"left\",\"text_size\":\"normal\"}],\"weight\":1}],\"margin\":\"0px 0px 0px 0px\"}],\"weight\":1}],\"margin\":\"16px 0px 0px 0px\"},{\"tag\":\"column_set\",\"flex_mode\":\"none\",\"horizontal_spacing\":\"default\",\"background_style\":\"default\",\"columns\":[{\"tag\":\"column\",\"elements\":[{\"tag\":\"div\",\"text\":{\"tag\":\"plain_text\",\"content\":\""+desc+"\\n\",\"text_size\":\"normal\",\"text_align\":\"left\",\"text_color\":\"default\"}}],\"width\":\"weighted\",\"weight\":1}]},{\"tag\":\"action\",\"actions\":[{\"tag\":\"button\",\"text\":{\"tag\":\"plain_text\",\"content\":\"查看详情\"},\"type\":\"default\",\"complex_interaction\":true,\"width\":\"default\",\"size\":\"medium\",\"multi_url\":{\"url\":\"\",\"pc_url\":\"https://admin.sida-tech.com/#/tasks/allTasks/allTasksRepair?id="+planId+"\",\"ios_url\":\"\",\"android_url\":\"\"}}]}]},\"i18n_header\":{\"zh_cn\":{\"title\":{\"tag\":\"plain_text\",\"content\":\"停梯工单签退通知\"},\"subtitle\":{\"tag\":\"plain_text\",\"content\":\"\"},\"template\":\"blue\"}}}";
		}
	}

}
